package com.quarkus.factory;

import cn.hutool.core.util.RandomUtil;
import io.vertx.core.json.JsonObject;
import io.vertx.reactivex.core.Vertx;
import io.vertx.reactivex.ext.web.client.WebClient;

/**
 * @Author: TongRui乀
 * @Date: 2021/3/20 16:13
 * @description：
 */
public class Test {

    public static void main(String[] args) {
        WebClient client = WebClient.create(Vertx.vertx());

        JsonObject jsonObject = new JsonObject();
        jsonObject.put("Receivers", "17763191612");
        jsonObject.put("Content", RandomUtil.randomNumbers(6));

        client.post("https://sms.comtele.com.br/api/v2")
                .sendJson(jsonObject, response->{
                    var res = response.result().bodyAsJsonObject();
                    System.out.println(res.toString());
                });
    }

}
